import React from 'react'
import PureRenderMixin from 'react-addons-pure-render-mixin'

import './style.less'

class BuyAndStore extends React.Component {
    constructor(props, context) {
        super(props, context);
        this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
    }
    render() {
        let {isStore,buyHandle,storeHandle} = this.props;
        // console.log(isStore)
        //  console.log(buyHandle)
        //  console.log(storeHandle)
        return (
            <div className="buy-store-container clear-fix">
                 <div className="buy-store-container clear-fix">
                <div className="item-container float-left">
                   {
                        isStore ?  <button  
                                            className="selected" 
                                            onClick={storeHandle}>
                                    已收藏</button> :
                         <button onClick={storeHandle} >收藏</button>
                   }
                </div>
                <div className="item-container float-right">
                    <button onClick={buyHandle}>购买</button>
                </div>
            </div> 
            </div>
        )
    }
}

export default BuyAndStore